package com.zero.test3;


import com.zero.test1.Person;

import java.util.Scanner;
import java.util.Timer;
import java.util.TimerTask;

public class Test {
    public static void main(String[] args) {
        Animal[] a = new Dog[2];
        a[0] = new Dog("小黑","01","黑");
        a[1] = new Dog("小白","02","白");
        ((Dog) a[0]).lookHome();
        for (int i = 0; i < a.length; i++) {
            a[i].eat();
            a[i].drink();
        }


        Swim[] s = new Chick[2];
        s[0] = new Chick("小蓝","01","黑色");
        s[1] = new Chick("小二","02","白色");

        for (int i = 0; i < s.length; i++) {
            if (s[i] instanceof Chick c){
                c.layEggs();
                c.eat();
                c.drink();
            }

    }
        Scanner sc = new Scanner(System.in);

        Person p = new Person();

    }
}
